<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录 - 白菜知识库AI系统</title>
    <style>
        body { font-family: Arial, sans-serif; background-color: #f0f2f5; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; }
        .login-container { background-color: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); width: 360px; text-align: center; }
        h1 { color: #333; margin-bottom: 20px; }
        .input-group { margin-bottom: 20px; }
        input[type="text"], input[type="password"] { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; }
        button { width: 100%; padding: 12px; background-color: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; }
        button:hover { background-color: #0056b3; }
        .error-message { color: #dc3545; margin-top: 15px; display: none; }
    </style>
</head>
<body>
    <div class="login-container">
        <h1>白菜知识库AI系统</h1>
        <form action="/login" method="post">
            <div class="input-group">
                <input type="text" name="username" placeholder="用户名" required value="testuser">
            </div>
            <div class="input-group">
                <input type="password" name="password" placeholder="密码" required value="123456">
            </div>
            <button type="submit">登 录</button>
        </form>
        <p id="error-message" class="error-message"></p>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const errorMessage = document.getElementById('error-message');
            const urlParams = new URLSearchParams(window.location.search);
            const error = urlParams.get('error');
            if (error) {
                errorMessage.textContent = decodeURIComponent(error);
                errorMessage.style.display = 'block';
            }
        });
    </script>
</body>
</html>
